$(document).ready(function(){
     //首先将#back-to-top隐藏
     // $("#back-to-top").hide();
     //当滚动条的位置处于距顶部600像素以下时，跳转链接出现，否则消失
     $(function () {
      $(window).scroll(function(){
       if ($(window).scrollTop()>600){
        $("#back-to-top").fadeIn(500);
       }else{
        $("#back-to-top").fadeOut(500);
       }
     });
     //当点击跳转链接后，回到页面顶部位置
     $("#back-to-top").click(function(){
      $('body,html').animate({scrollTop:0},500);
       return false;
      });
     });


    (function () {
        var localStorage = window.localStorage;
        // 是否支持localStorage
        if(localStorage){
            console.log('This browser supports localStorage');
        }else{
            console.log('This browser does NOT support localStorage');
        }
        //如果存在loacalStorage。。。业务逻辑
        if(localStorage.token && localStorage.wid){
            console.log(localStorage.token);
            $('.round_s').hide();
            $('#tokenBtn').show();
            // $('#login>a:eq(0)').attr('href','head_for/index.html');
            $('#login>a:eq(0)').attr('href','head_for/index.html').text('进入闪配');
            $('#login>a:eq(1)').hide();
            $('#login>span').hide();
            $('#tokenBtn').click(function () {
            })
        }else {
            $('.round_s').show();
            $('#tokenBtn').hide();
            // $('#login>a:eq(0)').attr('href','head_for/logIn/regesitor.html');
            $('#login>a:eq(0)').attr('href','head_for/logIn/regesitor.html').text('免费注册');
            $('#login>a:eq(1)').show();
            $('#login>span').show();
        }
    })()
});
